﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlApprovePhanTuyen.ascx.cs" Inherits="UserControl_ControlApprovePhanTuyen" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dxwpg" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraPivotGrid.Web" tagprefix="dxpgw" %>


<script type="text/javascript">
    function pageLoad() {

        $("#<%= btnView.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
    });
    $("#<%= btnApprove.ClientID %>").click(function () {
        $.blockUI({ css: {
            border: 'none',
            padding: '15px',
            backgroundColor: '#000',
            '-webkit-border-radius': '10px',
            '-moz-border-radius': '10px',
            opacity: .5,
            color: '#fff'
        }
        });
    });
        $("#<%= imgBtnSave.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });
        $("#<%= ImgBtnPivot.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }

    }

</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="imgBtnSave" />
<asp:PostBackTrigger ControlID="ImgBtnPivot" />
</Triggers>
    <ContentTemplate>
     <div class="direct_container_right_titletop">
                     Approve phân tuyến cho trình dược viên
                </div>
                 <hr />
                <!-- Button chuc nang-->
                <div class="direct_container_main">
                    
                    <asp:ImageButton ID="imgBtnSave" onclick="imgBtnSave_Click" CausesValidation="false" ToolTip="Xuất ra file excel dạng thường" ImageUrl="~/Images/download.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="ImgBtnPivot" onclick="ImgBtnPivot_Click" CausesValidation="false" ToolTip="Xuất ra file excel dạng pivot" ImageUrl="~/Images/rename.png" Width="32px" Height="32px" runat="server" />
                    
                </div>
                <!-- End Button chuc nang-->
                <div class="direct_container_main">
                    <table border="0" width="100%">
                        <tr>
                                   
                                    <td colspan="2">
                                       
                                        <asp:Button ID="btnView" runat="server" Text="Xem" onclick="btnView_Click"/>
                                        <asp:Button ID="btnApprove" runat="server" Text="Approve" onclick="btnApprove_Click"/>
                                    </td>
                          </tr>
                          <tr>
                          <td colspan="2">
                          <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid1"  runat="server">
                 <Fields>
                        <dxwpg:PivotGridField ID="Pivotsalesp_key" Area="RowArea"  AreaIndex="0" 
                         Caption="Trình dược viên" FieldName="salesp_key">
                        </dxwpg:PivotGridField>
                         <dxwpg:PivotGridField ID="PivotProvinceCode" Area="RowArea"  AreaIndex="1" 
                         Caption="Tỉnh/Thành" FieldName="ProvinceCode">
                        </dxwpg:PivotGridField>
                         <dxwpg:PivotGridField ID="PivotTownCode" Area="RowArea"  AreaIndex="2" 
                         Caption="Quận/Huyện" FieldName="QuanHuyen">
                        </dxwpg:PivotGridField>
                         <dxwpg:PivotGridField ID="Pivotcustomername" Area="RowArea"  AreaIndex="3" 
                         Caption="Khách hàng" FieldName="customername">
                        </dxwpg:PivotGridField>
                         <dxwpg:PivotGridField ID="Pivotaddress" Area="RowArea"  AreaIndex="4" 
                         Caption="Địa chỉ" FieldName="address">
                        </dxwpg:PivotGridField>
                         <dxwpg:PivotGridField ID="PivotNPPKH" Area="RowArea"  AreaIndex="5" 
                         Caption="NPP của khách hàng" FieldName="NPPKH">
                        </dxwpg:PivotGridField>
                         <dxwpg:PivotGridField ID="Pivotitemkey" Area="RowArea"  AreaIndex="7" 
                         Caption="Sản phẩm" FieldName="itemkey">
                        </dxwpg:PivotGridField>
                         <dxwpg:PivotGridField ID="PivotNPPSP" Area="RowArea"  AreaIndex="8" 
                         Caption="NPP của sản phẩm" FieldName="NPPSP">
                        </dxwpg:PivotGridField>
                    </Fields>
                    <OptionsPager Visible="False">
                    </OptionsPager>
                    <OptionsView  ShowColumnGrandTotals="True" ShowRowGrandTotals="True" />
                    </dxwpg:ASPxPivotGrid>
                          </td>
                          </tr>
                          
                            
                        
                    </table>  
                <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>    
     </ContentTemplate>
</asp:UpdatePanel>